<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>LeetCode全部题目-我的机器能学习</title>
    <meta name="description" content="我的机器能学习">
    <meta name="author" content="梁嘉腾">

    <link rel="shortcut icon " type="images/x-icon" href="../static/img/avatar.jpg">

    <!-- Bootstrap Core CSS -->
    <link href="../static/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <style>
        body {
            padding-top: 70px;
            /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
        }
    </style>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

</head>

<body>

<!-- Navigation -->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">

            <button type="button" class="navbar-toggle" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>

            <a class="navbar-brand" href="/leetcode/algorithm">LeetCode全部题目</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li>
                    <a href="/leetcode/algorithm">Problems</a>
                </li>
                <li>
                    <a href="http://www.liangjiateng.cn">Blog</a>
                </li>
                <li>
                    <a href="http://www.liangjiateng.cn/blog/services">Services</a>
                </li>
            </ul>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container -->
</nav>

<!-- Page Content -->
<div class="container" style="min-height: 650px">
    <div class="alert alert-info" role="alert">公告：本网站可以看到LeetCode所有题目（包括上锁的）和公司相关的题目。只为方便大众。目前暂时不能在线写代码（支持这个功能需要LeetCode VIP账号集群去给LeetCode服务器提交代码，成本较高）。</div>
    <div class="row">
        <div class="col-lg-9">
            <h1>LeetCode Problems</h1>
            <a type="button" class="btn btn-warning btn-lg" href="/leetcode/algorithm">Algorithm</a>
            <a type="button" class="btn btn-success btn-lg" href="/leetcode/database">Database</a>
            <div class="row" style="margin-top: 30px;margin-bottom: 30px">
                <div class="col-lg-6">
                    <div class="input-group">
                        <span class="input-group-addon" onclick="search()" style="cursor: pointer">Go</span>
                        <input id="search-content" type="text" class="form-control"
                               placeholder="Search question titles, description or IDs"/>
                        <script>
                            function search() {
                                var content = $("#search-content").val()
                                window.location.href = '/leetcode/search/' + content
                            }
                        </script>
                    </div><!-- /input-group -->
                </div><!-- /.col-lg-6 -->
                <div class="col-lg-6">
                    <div class="btn-group">
                        <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">Difficulty
                            <span class="caret"></span>
                        </button>
                        <ul class="dropdown-menu" role="menu">
                            <li>
                                <a href="/leetcode/{{ status['type'] }}?difficulty=1">Easy</a>
                            </li>
                            <li>
                                <a href="/leetcode/{{ status['type'] }}?difficulty=2">Medium</a>
                            </li>
                            <li>
                                <a href="/leetcode/{{ status['type'] }}?difficulty=3">Hard</a>
                            </li>
                        </ul>
                    </div>
                </div><!-- /.col-lg-6 -->
            </div>
            <table class="table table-striped">
                <thead>
                <tr>
                    <th>
                        <a href="/leetcode/{{ status['type'] }}?page={{ page }}&difficulty={{ status['difficulty'] }}&is_locked={{ status['is_locked'] }}&order={{ 1 if status['order'] == 0 else 0 }}">#<span
                                class="caret"></span></a></th>
                    <th>Title</th>
                    <th>
                        <a href="/leetcode/{{ status['type'] }}?page=1&difficulty={{ status['difficulty'] }}&is_locked={{ 0 if status['is_locked'] == 1 else 1 }}&order={{ status['order'] }}&frequency={{ status['frequency'] }}">VIP<span
                                class="caret"></span></a></th>
                    <th>Difficulty</th>
                    <th>
                        <a href="/leetcode/{{ status['type'] }}?page={{ page }}&difficulty={{ status['difficulty'] }}&is_locked={{ status['is_locked'] }}&order={{ status['order'] }}&frequency=1">Frequency<span
                                class="caret"></span></a></th>
                </tr>
                </thead>
                <tbody>
                {% for p in data['data'] %}
                    <tr>
                        <td>{{ p['lid'] }}</td>
                        <td><a
                                href="/leetcode/{{ p['title_slug'] }}/description">{{ p['title'] }}</a></td>
                        {% if p['is_locked'] == 0 %}
                            <td><span class="label label-default">Normal</span></td>
                        {% endif %}
                        {% if p['is_locked'] == 1 %}
                            <td><span class="label label-info">Prime</span></td>
                        {% endif %}
                        {% if p['difficulty'] == 1 %}
                            <td><span class="label label-success">Easy</span></td>
                        {% endif %}
                        {% if p['difficulty'] == 2 %}
                            <td><span class="label label-warning">Medium</span></td>
                        {% endif %}
                        {% if p['difficulty'] == 3 %}
                            <td><span class="label label-danger">Hard</span></td>
                        {% endif %}
                        <td>
                            <div class="progress"
                                 style="display: inline-block;width: 100px;height:10px;margin-bottom: 0;">
                                <div class="progress-bar progress-bar-success" role="progressbar"
                                     aria-valuenow="{{ p['frequency'] }}"
                                     aria-valuemin="0" aria-valuemax="7.54"
                                     style="width: {{ (p['frequency'] / 7.54)*100 }}%">
                                    <span class="sr-only">40% Complete (success)</span>
                                </div>
                            </div>
                        </td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
            <!-- Pagination -->
            <ul class="pagination justify-content-center mb-4">
                {% for i in range(1, data['max_page'] + 1) %}
                    {% if i == page %}
                        <li class="page-item active">
                            <a href="/leetcode/{{ status['type'] }}?page={{ i }}&difficulty={{ status['difficulty'] }}&is_locked={{ status['is_locked'] }}&order={{ status['order'] }}&frequency={{ status['frequency'] }}"
                               class="page-link active">{{ i }}</a>
                        </li>
                    {% else %}
                        <li class="page-item">
                            <a href="/leetcode/{{ status['type'] }}?page={{ i }}&difficulty={{ status['difficulty'] }}&is_locked={{ status['is_locked'] }}&order={{ status['order'] }}&frequency={{ status['frequency'] }}"
                               class="page-link active">{{ i }}</a>
                        </li>
                    {% endif %}
                {% endfor %}
            </ul>
        </div>
        <div class="col-lg-3">
            <h3>Companies</h3>
            <div class="list-group">
                {% for com in companies %}
                    <a href="/leetcode/{{ com[0] }}/algorithm" class="list-group-item">
                        <span class="badge">{{ com[1] }}</span>
                        {{ com[0] }}
                    </a>
                {% endfor %}
            </div>
        </div>
    </div>
    <!-- /.row -->

</div>
<!-- /.container -->
<!-- Footer -->
<footer class="py-5 bg-dark" style="height: 100px;background: #101010">
    <div class="container">
        <p class="m-0 text-center text-white" style="margin-top: 40px;color: #9d9d9d">Copyright &copy; Jiateng Liang's
            Blog 2018</p>
    </div>
    <!-- /.container -->
</footer>
<!-- jQuery Version 1.11.1 -->
<script src="../static/js/jquery.js"></script>

<!-- Bootstrap Core JavaScript -->
<script src="../static/js/bootstrap.min.js"></script>
</body>

</html>
